#include "mbutton.h"
#include "ui_mbutton.h"

MButton::MButton(QWidget *parent) :
    QPushButton(parent),
    ui(new Ui::MButton)
{
    ui->setupUi(this);
    isnull = true;
    iconpath = "";
}


MButton::~MButton()
{
    delete ui;
}

//void MButton::set_butt_Information(BUTTON_TYPE type,QString name,QString path)
//{
//    buttmode = type;
//    filename = name;
//    filepath = path;
//    this->setText(name);
//}

void MButton::set_butt_Information(BUTTON_TYPE type, QString name, QString path, QIcon icon)
{
    buttmode = type;
    filename = name;
    filepath = path;

    if(!icon.isNull())
    {
        this->setIcon(icon);
    }

    this->setText(name);
}

void MButton::set_isnull(bool is_null)
{
    isnull = is_null;
}

void MButton::set_iconpath(QString path)
{
    iconpath = path;
}

void MButton::set_filename(QString name)
{
    filename = name;
}

void MButton::set_filepath(QString path)
{
    filepath = path;
}

bool MButton::get_isnull()
{
    return isnull;
}

uint8_t MButton::get_buttname()
{
    return buttmode;
}

QString MButton::get_filename()
{
    return filename;
}

QString MButton::get_filepath()
{
    return filepath;
}

QString MButton::get_iconpath()
{
    return iconpath;
}



